//
//  OosMediaActivityObject.m
//  Oos4ios
//
//  Created by Pablo Gonzalez on 4/4/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import <oos4ios/Model/OosMediaActivityObject.h>

@implementation OosMediaActivityObject

@end

@implementation OosPictureActivityObject

static NSString *imagePredicate = @"image.identifier = %@";

+ (OosPictureActivityObject *) objectFromIdentifier:(NSString *)identifier
{
    OosPictureActivityObject *result = [self objectWithPredicate:imagePredicate, identifier];
    if (result == nil) {
        result = [self create];
        result.image = [OosImage imageFromIdentifier:identifier];
    }
    return result;
}

@dynamic image;

@end

@implementation OosVideoActivityObject

static NSString *videoPredicate = @"video.identifier = %@";

+ (OosVideoActivityObject *) objectFromIdentifier:(NSString *)identifier
{
    OosVideoActivityObject *result = [self objectWithPredicate:videoPredicate, identifier];
    if (result == nil) {
        result = [self create];
        result.video = [OosVideo videoFromIdentifier:identifier];
    }
    return result;
}

@dynamic video;

@end




